#define WIN32_LEAN_AND_MEAN

#include<windows.h>
#include<BWAPI.h>
#include<process.h>

#include"Micro.h"

namespace BWAPI
{
	Game* Broodwar;
}

BOOL APIENTRY DllMain(HANDLE hModule,
					  DWORD ul_reason_for_call,
					  LPVOID lpReserved
					  )
{
	switch(ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		BWAPI::BWAPI_init();
		break;
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}



extern "C" __declspec(dllexport) BWAPI::AIModule* newAIModule(BWAPI::Game* game)
{
	BWAPI::Broodwar = game;

	BWAPI::AIModule* micro = new Micro();
	_beginthread(VisualizerThread , 0 , (void*)micro);

	return micro;
}